<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>Untitled Document</title>
		<script type="application/javascript" src="js/eventcache.js"></script>
		
		<script type="text/javascript" src="http://www.google.com/jsapi">
        </script>
        <script type="text/javascript" src="js/util.js">
        </script>

		<script type="application/javascript" >
			google.load("gdata", "1");
			google.setOnLoadCallback(doit);

			//var calendarService = new google.gdata.calendar.CalendarService('GoogleInc-jsguide-1.0');
			function doit(){
				testEventCache();
			}
			function testEventCache()
			{
				var entry = new google.gdata.calendar.CalendarEventEntry();
				entry.setTitle(google.gdata.Text.create("abc"));
				entry.setId(new google.gdata.atom.Id());
				entry.getId().setValue("http://www.google.com/calendar/feeds/5rv0fbcj98mi144hee1v1ds9qc%40group.calendar.google.com/private/full/k5m8df58b3aq7unbhd4c8piul8");
				

				
				//用add  添加
				Cache.Events.add(entry, "http://www.google.com/calendar/feeds/5rv0fbcj98mi144hee1v1ds9qc%40group.calendar.google.com/private/full");
				
				var entry2 = new google.gdata.calendar.CalendarEventEntry();
				entry2.setTitle(google.gdata.Text.create("abcd"));
				entry2.setId(new google.gdata.atom.Id());
				entry2.getId().setValue("http://www.google.com/calendar/feeds/idning%40gmail.com/private/full/k6jt6s3h4egbrrpok5hhteopeg");
				Cache.Events.addEvent(entry2);
				log("entry.getId().getValue():"+entry.getId().getValue());
				log(Cache.Events.getById(entry.getId().getValue()));
				log ("test1:");
				log(Cache.Events.getById(entry.getId().getValue()).getTitle().getText()=="abc");
				log ("test2:");
				log(Cache.Events.getById("id of event") == null);
				log ("test3:");
				log(Cache.Events.getById(entry2.getId().getValue()).getTitle().getText()=="abcd");
				

				log ("test remove:");
				Cache.Events.remove(entry.getId().getValue());//删除entry1
				log(Cache.Events.getById(entry.getId().getValue())==undefined);
				
				
			}
			
			
		</script>
		
	</head>
	<body>
	</body>
</html>
